<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	<link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
	<link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
	<link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
	<script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
	<script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
	<link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
	<script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}"></script>
	<script src="{yun:}$config.sy_weburl{/yun}/js/layui/phpyun_layer.js?v={yun:}$config.cachecode{/yun}"></script>
	<title>后台管理</title>
</head>

<script>

	function sendmsg(type,emailtype,emailtpl,dayslimit,status,value,msg,ok,notOk){
		 
		if(status=="3"){
 			var pagelimit=20;
			var pytoken=$("input[name='pytoken']").val();
			var ii = parent.layer.msg(msg,5000,{icon:16,shade:0.01})
			$.post("index.php?m=email&c=sendPromotion",{
				action:"sendEmailMsg",
				type:type,emailtype:emailtype,emailtpl:emailtpl,dayslimit:dayslimit,pytoken:pytoken,
				value:value,ok:ok,notOk:notOk,
				pagelimit:pagelimit
				},
				function(data){
					parent.layer.close(ii);
					var data=eval('('+data+')');
					sendmsg(type,emailtype,emailtpl,dayslimit,data.status,data.value,data.msg,data.ok,data.notOk)
				})
		}else{
			parent.layer.close(ii);
			parent.layer.msg(msg, 9);
			location.reload();
		}
	}

	 

	$(window).load(function(){ 
		var request = new XMLHttpRequest();
		request.open("GET", "index.php?m=email&c=getBirthday");
		request.send();
		request.onreadystatechange = function() {
			if (request.readyState===4) {
				if (request.status===200) { 
					var num=JSON.parse(request.responseText);
					document.getElementById("birthday").innerHTML    = num.birthday_m;
					if(num.birthday_m==0){
						$("#bpost").attr("disabled",true);
						$("#bpost").attr("class","admin_unclick");
					}
					document.getElementById("anniversary").innerHTML = num.anniversary_m;
					if(num.anniversary_m==0){
						$("#apost").attr("disabled",true);
						$("#apost").attr("class","admin_unclick");
					}
					document.getElementById("todaydue").innerHTML    = num.todaydue_m;
					if(num.todaydue_m==0){
						$("#tpost").attr("disabled",true);
						$("#tpost").attr("class","admin_unclick");
					} 
					document.getElementById("sevendue").innerHTML    = num.sevendue_m;
					if(num.sevendue_m==0){
						$("#spost").attr("disabled",true);
						$("#spost").attr("class","admin_unclick");
					}
					document.getElementById("useradd").innerHTML     = num.useradd_m;
					if(num.useradd_m==0){
						$("#useraddpost").attr("disabled",true);
						$("#useraddpost").attr("class","admin_unclick");
					}
					document.getElementById("userup").innerHTML      = num.userup_m;
					if(num.userup_m==0){
						$("#useruppost").attr("disabled",true);
						$("#useruppost").attr("class","admin_unclick");
					}
					document.getElementById("addjob").innerHTML      = num.addjob_m;
					if(num.addjob_m==0){
						$("#addjobpost").attr("disabled",true);
						$("#addjobpost").attr("class","admin_unclick");
					}
					document.getElementById("upjob").innerHTML       = num.upjob_m;
					if(num.upjob_m==0){
						$("#upjobpost").attr("disabled",true);
						$("#upjobpost").attr("class","admin_unclick");
					}
				}
			} 
		}
	});

</script>

<body class="body_ifm">

<div class="infoboxp">
	<div class="tabs_info">
		<ul>
			<li {yun:}if $smarty.get.c==''{/yun}class="curr"{yun:}/if{/yun}><a  href="index.php?m=email">邮件推广</a></li>
			<li {yun:}if $smarty.get.c=='msgtg'{/yun}class="curr"{yun:}/if{/yun}><a href="index.php?m=email&c=msgtg">短信推广</a></li>
			<li {yun:}if $smarty.get.c=='tgresume'{/yun}class="curr"{yun:}/if{/yun} ><a href="index.php?m=email&c=tgresume">简历推广</a></li>
			<li {yun:}if $smarty.get.c=='tgjob'{/yun}class="curr"{yun:}/if{/yun} > <a href="index.php?m=email&c=tgjob">职位推广</a></li>
			<li {yun:}if $smarty.get.c=='email'{/yun}class="curr"{yun:}/if{/yun} ><a href="index.php?m=email&c=email">自定义邮件</a></li> 
			<li {yun:}if $smarty.get.c=='msg'{/yun}class="curr"{yun:}/if{/yun}><a  href="index.php?m=email&c=msg">自定义短信</a></li>
		</ul>
	</div>

	<div class="clear"></div>
	
	<div class="admin_new_tip">
		<a href="javascript:;" class="admin_new_tip_close"></a>
		<a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
		
		<div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
    
		<div class="admin_new_tip_list_cont">
			<div class="admin_new_tip_list">发送短信时，请选择合适的时间进行发送</div>
		</div>

	</div>

	<div class="clear"></div>

	<div class="tag_box mt10">
		<table width="100%" class="table_form ">
			<tr><tbody><th bgcolor="#f0f6fb" colspan="2" ><span class="admin_bold">短信推广</span></th></tbody></tr>
			<tr>
				<th width="310">今天过生日的用户:</th>
				<td>
					<div class="admin_msgtg_f">
						符合用户数：<font color="red" id="birthday">0</font> 位
						{yun:}if $birthday.ctime{/yun}，上次发送时间：<font color="red">{yun:}$birthday.ctime|date_format:"%Y-%m-%d"{/yun}</font>{yun:}/if{/yun}。
					</div>
					<input class="{yun:}if $birthday.disabled==1{/yun}admin_unclick{yun:}else{/yun}admin_button{yun:}/if{/yun}" id="bpost"type="submit" onclick="sendmsg('1','1','1','0','3','0','正在发送，请稍候。。。','0','0')" value="&nbsp;发送短信&nbsp;"  {yun:}if $birthday.disabled==1{/yun}disabled="disabled"{yun:}/if{/yun}/>
				</td>
			</tr>
			<tr>
				<th >周年提醒（所有用户）:</th>
				<td>
					<div class="admin_msgtg_f">
						符合用户数：<font color="red" id="anniversary">0</font> 位
						{yun:}if $anniversary.ctime{/yun}，上次发送时间：<font color="red">{yun:}$anniversary.ctime|date_format:"%Y-%m-%d"{/yun}</font>{yun:}/if{/yun}。
					</div>
					<input class="{yun:}if $anniversary.disabled==1{/yun}admin_unclick{yun:}else{/yun}admin_button{yun:}/if{/yun}" id="apost" type="submit"onclick="sendmsg('2','2','1','0','3','0','正在发送，请稍候。。。','0','0')" value="&nbsp;发送短信&nbsp;"  {yun:}if $anniversary.disabled==1{/yun}disabled="disabled"{yun:}/if{/yun}/>
				</td>
			</tr>
			<tr>
				<th >今日会员到期提醒（企业用户）:</th>
				<td>
					<div class="admin_msgtg_f">
						符合用户数：<font color="red" id="todaydue">0</font> 位{yun:}if $todaydue.ctime{/yun}，上次发送时间：<font color="red">{yun:}$todaydue.ctime|date_format:"%Y-%m-%d"{/yun}</font>{yun:}/if{/yun}。
					</div>
					<input class="{yun:}if $todaydue.disabled==1{/yun}admin_unclick{yun:}else{/yun}admin_button{yun:}/if{/yun}" id="tpost" type="submit"onclick="sendmsg('1','3','1','1','3','0','正在发送，请稍候。。。','0','0')" value="&nbsp;发送短信&nbsp;"  {yun:}if $todaydue.disabled==1{/yun}disabled="disabled"{yun:}/if{/yun}/>
				</td>
			</tr>
			<tr>
				<th>7日会员到期提醒（企业用户）:</th>
				<td>
					<div class="admin_msgtg_f">
						符合用户数：<font color="red" id="sevendue">0</font> 位
						{yun:}if $sevendue.ctime{/yun}，上次发送时间：<font color="red">{yun:}$sevendue.ctime|date_format:"%Y-%m-%d"{/yun}</font>{yun:}/if{/yun}。
					</div>
					<input class="{yun:}if $sevendue.disabled==1{/yun}admin_unclick{yun:}else{/yun}admin_button{yun:}/if{/yun}" id="spost"type="submit" onclick="sendmsg('1','3','1','7','3','0','正在发送，请稍候。。。','0','0')" value="&nbsp;发送短信&nbsp;"  {yun:}if $sevendue.disabled==1{/yun}disabled="disabled"{yun:}/if{/yun}/>
				</td>
			</tr>
			<tr>
				<th>注册后7日内未发布简历（个人用户）:</th>
				<td>
					<div class="admin_msgtg_f">
						符合用户数：<font color="red" id="useradd">0</font> 位
						{yun:}if $useradd.ctime{/yun}，上次发送时间：<font color="red">{yun:}$useradd.ctime|date_format:"%Y-%m-%d"{/yun}</font>{yun:}/if{/yun}。
					</div>
					<input class="{yun:}if $useradd.disabled==1{/yun}admin_unclick{yun:}else{/yun}admin_button{yun:}/if{/yun}" id="useraddpost"type="submit" onclick="sendmsg('1','4','1','7','3','0','正在发送，请稍候。。。','0','0')" value="&nbsp;发送短信&nbsp;"  {yun:}if $useradd.disabled==1{/yun}disabled="disabled"{yun:}/if{/yun}/>
				</td>
			</tr>
			<tr>
				<th>7日未刷新简历（个人用户）:</th>
				<td>
					<div class="admin_msgtg_f">
						符合用户数：<font color="red" id="userup">0</font> 位
						{yun:}if $userup.ctime{/yun}，上次发送时间：<font color="red">{yun:}$userup.ctime|date_format:"%Y-%m-%d"{/yun}</font>{yun:}/if{/yun}。
					</div>
					<input class="{yun:}if $userup.disabled==1{/yun}admin_unclick{yun:}else{/yun}admin_button{yun:}/if{/yun}" id="useruppost" type="submit"onclick="sendmsg('1','5','1','7','3','0','正在发送，请稍候。。。','0','0')" value="&nbsp;发送短信&nbsp;"  {yun:}if $userup.disabled==1{/yun}disabled="disabled"{yun:}/if{/yun}/>
				</td>
			</tr>
			<tr>
				<th>7日未发布职位（企业用户）</th>
				<td>
					<div class="admin_msgtg_f">
						符合用户数：<font color="red" id="addjob">0</font> 位
						{yun:}if $addjob.ctime{/yun}，上次发送时间：<font color="red">{yun:}$addjob.ctime|date_format:"%Y-%m-%d"{/yun}</font>{yun:}/if{/yun}。
					</div>
					<input class="{yun:}if $addjob.disabled==1{/yun}admin_unclick{yun:}else{/yun}admin_button{yun:}/if{/yun}" id="addjobpost" type="submit"onclick="sendmsg('2','6','1','7','3','0','正在发送，请稍候。。。','0','0')" value="&nbsp;发送短信&nbsp;"  {yun:}if $addjob.disabled==1{/yun}disabled="disabled"{yun:}/if{/yun}/>
				</td>
			</tr>
			<tr>
				<th>7日未刷新职位（企业用户）</th>
				<td>
					<div class="admin_msgtg_f">
						符合用户数：<font color="red" id="upjob">0</font> 位
						{yun:}if $upjob.ctime{/yun}，上次发送时间：<font color="red">{yun:}$upjob.ctime|date_format:"%Y-%m-%d"{/yun}</font>{yun:}/if{/yun}。
					</div>
					<input class="{yun:}if $upjob.disabled==1{/yun}admin_unclick{yun:}else{/yun}admin_button{yun:}/if{/yun}" id="upjobpsot"type="submit" onclick="sendmsg('2','7','1','7','3','0','正在发送，请稍候。。。','0','0')" value="&nbsp;发送短信&nbsp;"  {yun:}if $upjob.disabled==1{/yun}disabled="disabled"{yun:}/if{/yun}/>
				</td>
			</tr>
		</table>
		<input type="hidden" name="pytoken" value="{yun:}$pytoken{/yun}">
	</div>
</div>

</body>
</html>